package edu.jd.log;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LogDao {

    @Insert("insert into log (user_id, auth_id, role_id, time, state) " +
            "values (#{user_id}, #{auth_id}, #{role_id}, #{time}, #{state})")
    public void insertLog(Log log);

    @Select("select log_id, user_id, role_name, auth_name, state, time " +
            "from log, role, authority " +
            "where log.auth_id = authority.auth_id " +
            "and log.role_id = role.role_id")
    public List<LogDto> getAllLog();
}
